﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HCQ2_Model;
using HCQ2_Model.Data;
using HCQ2_Model.Pay;
using HCQ2_Model.ViewModel;

namespace HCQ2_IDAL
{
    /// <summary>
    /// 订单信息
    /// </summary>
    public partial interface IN_OrderDAL
    {
        /// <summary>
        /// 获取购买商品信息
        /// </summary>
        /// <param name="fileId"></param>
        /// <returns></returns>
        List<T_DocumentInfo> ListDocumentInfo(List<int> fileId);
        /// <summary>
        /// 获取购买商品的价格信息
        /// </summary>
        /// <param name="commodityInfos">购买商品ID、购买期限</param>
        /// <returns></returns>
        List<PaymentAmountParamsCommodityDetailedInfo> ListPayCommodityDetailedInfo(List<PaymentAmountParamsCommodityInfo> commodityInfos);

        /// <summary>
        /// 获取订单中商品ID和商品购买期限
        /// </summary>
        /// <param name="parentOrderCode"></param>
        /// <returns></returns>
        List<PaymentAmountParamsCommodityInfo> ListPaymentAmountParamsCommodityInfo(string parentOrderCode);
        /// <summary>
        /// 获取订单列表
        /// </summary>
        /// <param name="listParams"></param>
        /// <returns></returns>
        OperationResult<TableModel<List<OrderListModel>>> ListOrderList(GetOrderListParams listParams);

        /// <summary>
        /// 获取父订单号列表
        /// </summary>
        /// <param name="listParams"></param>
        /// <returns></returns>
        OperationResult<GetParentOrderListTableModel> ListParentOrderList(GetParentOrderListParams listParams);

        /// <summary>
        /// 获取订单详细
        /// </summary>
        /// <param name="detailedParams"></param>
        /// <returns></returns>
        OperationResult<GetOrderDetailedModel> GetOrderDetailed(GetOrderDetailedParams detailedParams);
        /// <summary>
        /// 获取PC订单列表
        /// </summary>
        /// <param name=""></param>
        /// <param name=""></param>
        /// <returns></returns>
        OperationResult<TableModel> ListOrderList(GetPcOrderListParams listParams);

        /// <summary>
        /// 获取PC订单列表导出数据源
        /// </summary>
        /// <param name="listParams"></param>
        /// <returns></returns>
        DataTable ListOrderListExpData(GetPcOrderListParams listParams);

        /// <summary>
        /// 获取订单数量
        /// </summary>
        /// <param name="orderState"></param>
        /// <returns></returns>
        int GetOrderTotal(GetOrderTotalParams getOrderTotalParams);

        /// <summary>
        /// 获取订单当前状态
        /// </summary>
        /// <param name="parentOrderCode">父订单ID</param>
        /// <returns></returns>
        Nullable<int> GetOrderState(string parentOrderCode);

        /// <summary>
        /// 取消订单
        /// </summary>
        /// <param name="parentOrderCode"></param>
        /// <returns></returns>
        int CancelOrder(string parentOrderCode);

        /// <summary>
        /// 验证商品是否存在未付款订单
        /// </summary>
        /// <param name="userId">用户</param>
        /// <param name="commodityId">商品ID</param>
        /// <returns>不为空 表示存在、为空表示 不存在</returns>
        string CheckCommodityUnpaidOrder(int userId,int commodityId);

        /// <summary>
        /// 验证商品是否已经购买并在有效期内
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="commodityId">商品ID</param>
        /// <returns>不为空 表示已经购买并且在有效期内，为空表示 没有购买或已经过期了</returns>
        string CheckCommodityPay(int userId, int commodityId);

        /// <summary>
        /// 验证商品是否已经购买并在24小时内，有效期内
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="commodityId"></param>
        /// <returns></returns>
        string CheckDevice24TermOfValidity(int userId, int commodityId);
        /// <summary>
        ///  获取用户-购买商品有效期截止时间
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="fileId"></param>
        /// <returns></returns>
        string GetPayEndTime(int userId,int fileId);

        /// <summary>
        /// 获取我的订单统计
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="param">请求的参数</param>
        /// <returns></returns>
        OrderStatisticsModel GetOrderStatistics(int userId, OrderStatisticsParams param);

        /// <summary>
        /// 更新备货状态：0=待备货（默认值）、1=备货中、2=备货完成、3=已发货
        /// </summary>
        /// <param name="param"></param>
        OperationResult UpdateStorageStatus(UpdateStorageStatusParams param);

        /// <summary>
        /// 更新订单接单人
        /// </summary>
        /// <param name="param"></param>
        OperationResult UpdateOrderReceivingUser(UpdateOrderReceivingUserParams param);

        /// <summary>
        /// 按父订单号分组合计订单数量
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        OperationResult GetParentGroupOrderTotal(GetParentGroupOrderTotalParams param);

        /// <summary>
        /// 获取店铺订单统计<br/>
        /// 需求《度度圈需求规格-订单统计-20220120.docx》添加
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        GetStoreOrderStatModel GetStoreOrderStat(GetStoreOrderStatParams param);

        /// <summary>
        /// 获取店铺商品销量统计<br/>
        /// 需求《度度圈需求规格-订单统计-20220120.docx》添加
        /// </summary>
        /// <param name="parsm"></param>
        /// <returns></returns>
        List<GetStoreGoodsStatModel> GetStoreGoodsStat(GetStoreGoodsStatParams parsm);
    }
}
